import { service } from "@/utils/request";

/**
 * 
 * @param {商用-盘库管理(日盘,年盘)};
 * @param {列表查询}
 * @returns 
 * 
 */
export const getList = (data: object) => {
  return service({
    url: '/inventory-task/list',
    method: 'post',
    data
  })
};

/**
 * 
 * @param {商用-盘库管理(日盘,年盘)};
 * @param {完成任务}
 * @returns 
 * 
 */
export const updateTask = (data: object) => {
  return service({
    url: '/inventory-task/edit',
    method: 'post',
    data
  })
};

/**
 * 
 * @param {商用-盘库管理(日盘,年盘)};
 * @param {删除任务}
 * @returns 
 * 
 */
export const removeTask = (data: object) => {
  return service({
    url: '/inventory-task/remove',
    method: 'post',
    data
  })
};

/**
 * 
 * @param {商用-盘库管理(日盘,年盘)};
 * @param {任务详情列表}
 * @returns 
 * 
 */
export const getTaskList = (data: object) => {
  return service({
    url: '/inventory-task/archives/list/taskId',
    method: 'post',
    data
  })
};

/**
 * 
 * @param {商用-盘库管理(日盘,年盘)};
 * @param {导出}
 * @returns 
 * 
 */
export const downloadTable = (data: object) => {
  return service({
    url: '/inventory-task/archives/list/exportExcel',
    method: 'post',
    data,
    responseType:'blob'
  })
};

/**
 * 
 * @param {商用-盘库管理(日盘,年盘)};
 * @param {新建任务}
 * @returns 
 * 
 */
export const createTask = (data: object) => {
  return service({
    url: '/inventory-task/create',
    method: 'post',
    data
  })
};

/**
 * 
 * @param {商用-盘库管理(年盘)};
 * @param {导入}
 * @returns 
 * 
 */
export const importExcel = (data: object) => {
  return service({
    url: '/inventory-task/archives/list/importExcel',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
  })
};
